package com.function.service;

import com.function.domin.dto.BucketDTO;
import com.function.domin.dto.DownloadDTO;
import com.function.domin.pojo.Upload;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
* @author WiedersehenM
* @description 针对表【upload(上传文件记录)】的数据库操作Service
* @createDate 2024-07-03 11:54:05
*/
public interface OSSService extends IService<Upload> {

    /**
     * 创建bucket
     * @param bucketDTO
     */
    void createBucket(BucketDTO bucketDTO);

    /**
     * 删除bucket
     * @param bucketDTO
     */
    void deleteBucket(BucketDTO bucketDTO);

    /**
     * 上传文件至阿里云oss
     * @param image
     * @return
     */
    String upload(MultipartFile image) throws IOException;

    /**
     * 从oss下载文件至本地
     * @param downloadDTO
     * @return
     */
    String download(DownloadDTO downloadDTO);
}
